/*
 *  funcs/attribute.c
 *
 *  (C) 2011 Harry Wei
 */

#include <stdio.h>

/*
 * int value __attribute__ ((aligned(n)));
 * Set the value with n bytes's memory same.
 * NOTE: XXX ??? n must be the power of two.
 */

struct a {
	/* b	0x0000
	   c	0x0001
	  	0x0002
		0x0003
		0x0004
	   d	0x0005
	   	0x0006
	struct:	0x0007
	*/
	char b __attribute__ ((aligned(1)));
	int c __attribute__ ((aligned(1)));
	char d __attribute__ ((aligned(1)));
};

int main(void)
{
	struct a m;

	printf("size: %d\n", sizeof(struct a));
	printf("%p\n%p\n%p\n", &m.b, &m.c, &m.d);
	return 0;
}
